<?php

$tensanpham = $_REQUEST['tensanpham'];
$hinhsanpham = $_REQUEST['hinhsanpham'];
$gia = $_REQUEST['gia'];
$id_danhmuc = $_REQUEST['id_danhmuc'];
$ngaycapnhat = $_REQUEST['ngaycapnhat'];
$tinhtrang = $_REQUEST['tinhtrang'];

include 'conn.php';

$sql = "insert into sanpham(tensanpham,hinhsanpham,gia,id_danhmuc,ngaycapnhat,tinhtrang) values('$tensanpham','$hinhsanpham',$gia,$id_danhmuc,'$ngaycapnhat',$tinhtrang)";
$result = @mysql_query($sql);
if ($result){
	echo json_encode(array('success'=>true));
} else {
	echo json_encode(array('msg'=>'Some errors occured.'));
}
?>